package cn.java63.biz2;

import cn.java63.biz.User;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserServiceAno {
    public boolean add(User u){
        System.out.println("新用户"+u+"加入了数据库");
        return u.getId()%2==0;
    }
    public boolean update(User u){
        System.out.println("老用户"+u+"被修改了");
        return u.getId()%2==0;
    }
    public boolean del(long id){
        System.out.println("用户"+id+" 被删除了");
        return true;
    }

    public List<User> search(){
        User user1=new User(2L,"admin","123456","13645215236","2545945622");
        User user2=new User(3L,"admin","14528455","13645212145","25424455622");
        User user3=new User(4L,"admin","1824395","13145215525","1452455622");
        User user4=new User(5L,"admin","11111","111111","1452455622");
        List<User> list=new ArrayList<>();
        list.add(user1);
        list.add(user2);
        list.add(user3);
        list.add(user4);
        return list;
    }
}
